#pragma once

#include once "windef.bi"
#include once "winapifamily.bi"
#include once "pshpack1.bi"
#include once "poppack.bi"

#define __USB100_H__
#define __USBSPEC_H__

type _USB_DEVICE_SPEED as long
enum
	UsbLowSpeed = 0
	UsbFullSpeed
	UsbHighSpeed
	UsbSuperSpeed
end enum

type USB_DEVICE_SPEED as _USB_DEVICE_SPEED

type _USB_DEVICE_TYPE as long
enum
	Usb11Device = 0
	Usb20Device
end enum

type USB_DEVICE_TYPE as _USB_DEVICE_TYPE

union _BM_REQUEST_TYPE
	'' TODO: __C89_NAMELESS struct _BM { UCHAR Recipient:2; UCHAR Reserved:3; UCHAR Type:2; UCHAR Dir:1; };
	B as UCHAR
end union

type BM_REQUEST_TYPE as _BM_REQUEST_TYPE
type PBM_REQUEST_TYPE as _BM_REQUEST_TYPE ptr

union _wValue
	'' TODO: __C89_NAMELESS struct { UCHAR LowByte; UCHAR HiByte; };
	W as USHORT
end union

union _wIndex
	'' TODO: __C89_NAMELESS struct { UCHAR LowByte; UCHAR HiByte; };
	W as USHORT
end union

type _USB_DEFAULT_PIPE_SETUP_PACKET
	bmRequestType as BM_REQUEST_TYPE
	bRequest as UCHAR
	wValue as _wValue
	wIndex as _wIndex
	wLength as USHORT
end type

type USB_DEFAULT_PIPE_SETUP_PACKET as _USB_DEFAULT_PIPE_SETUP_PACKET
type PUSB_DEFAULT_PIPE_SETUP_PACKET as _USB_DEFAULT_PIPE_SETUP_PACKET ptr
const BMREQUEST_HOST_TO_DEVICE = 0
const BMREQUEST_DEVICE_TO_HOST = 1
const BMREQUEST_STANDARD = 0
const BMREQUEST_CLASS = 1
const BMREQUEST_VENDOR = 2
const BMREQUEST_TO_DEVICE = 0
const BMREQUEST_TO_INTERFACE = 1
const BMREQUEST_TO_ENDPOINT = 2
const BMREQUEST_TO_OTHER = 3
'' TODO: #define USB_DESCRIPTOR_MAKE_TYPE_AND_INDEX(d, i) ((USHORT) (((USHORT) d) << 8 | i))
const USB_REQUEST_GET_STATUS = &h00
const USB_REQUEST_CLEAR_FEATURE = &h01
const USB_REQUEST_SET_FEATURE = &h03
const USB_REQUEST_SET_ADDRESS = &h05
const USB_REQUEST_GET_DESCRIPTOR = &h06
const USB_REQUEST_SET_DESCRIPTOR = &h07
const USB_REQUEST_GET_CONFIGURATION = &h08
const USB_REQUEST_SET_CONFIGURATION = &h09
const USB_REQUEST_GET_INTERFACE = &h0a
const USB_REQUEST_SET_INTERFACE = &h0b
const USB_REQUEST_SYNC_FRAME = &h0c
const USB_REQUEST_SET_SEL = &h30
const USB_REQUEST_ISOCH_DELAY = &h31
const USB_DEVICE_DESCRIPTOR_TYPE = &h01
const USB_CONFIGURATION_DESCRIPTOR_TYPE = &h02
const USB_STRING_DESCRIPTOR_TYPE = &h03
const USB_INTERFACE_DESCRIPTOR_TYPE = &h04
const USB_ENDPOINT_DESCRIPTOR_TYPE = &h05
const USB_DEVICE_QUALIFIER_DESCRIPTOR_TYPE = &h06
const USB_OTHER_SPEED_CONFIGURATION_DESCRIPTOR_TYPE = &h07
const USB_INTERFACE_POWER_DESCRIPTOR_TYPE = &h08
const USB_OTG_DESCRIPTOR_TYPE = &h09
const USB_DEBUG_DESCRIPTOR_TYPE = &h0a
const USB_INTERFACE_ASSOCIATION_DESCRIPTOR_TYPE = &h0b
const USB_BOS_DESCRIPTOR_TYPE = &h0f
const USB_DEVICE_CAPABILITY_DESCRIPTOR_TYPE = &h10
const USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_TYPE = &h30
const USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR_TYPE = &h31
const USB_RESERVED_DESCRIPTOR_TYPE = &h06
const USB_CONFIG_POWER_DESCRIPTOR_TYPE = &h07
const USB_FEATURE_ENDPOINT_STALL = &h00
const USB_FEATURE_REMOTE_WAKEUP = &h01
const USB_FEATURE_TEST_MODE = &h02
const USB_FEATURE_FUNCTION_SUSPEND = &h00
const USB_FEATURE_U1_ENABLE = &h30
const USB_FEATURE_U2_ENABLE = &h31
const USB_FEATURE_LTM_ENABLE = &h32
const USB_FEATURE_LDM_ENABLE = &h35
const USB_FEATURE_BATTERY_WAKE_MASK = &h28
const USB_FEATURE_OS_IS_PD_AWARE = &h29
const USB_FEATURE_POLICY_MODE = &h2A
const USB_FEATURE_CHARGING_POLICY = &h36
const USB_CHARGING_POLICY_DEFAULT = &h00
const USB_CHARGING_POLICY_ICCHPF = &h01
const USB_CHARGING_POLICY_ICCLPF = &h02
const USB_CHARGING_POLICY_NO_POWER = &h03
const USB_STATUS_PORT_STATUS = &h00
const USB_STATUS_PD_STATUS = &h01
const USB_STATUS_EXT_PORT_STATUS = &h02
const USB_GETSTATUS_SELF_POWERED = &h01
const USB_GETSTATUS_REMOTE_WAKEUP_ENABLED = &h02
const USB_GETSTATUS_U1_ENABLE = &h04
const USB_GETSTATUS_U2_ENABLE = &h08
const USB_GETSTATUS_LTM_ENABLE = &h10

union _USB_DEVICE_STATUS
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT SelfPowered : 1; USHORT RemoteWakeup : 1; USHORT U1Enable : 1; USHORT U2Enable : 1; USHORT LtmEnable : 1; USHORT Reserved : 11; };
end union

type USB_DEVICE_STATUS as _USB_DEVICE_STATUS
type PUSB_DEVICE_STATUS as _USB_DEVICE_STATUS ptr

union _USB_INTERFACE_STATUS
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT RemoteWakeupCapable : 1; USHORT RemoteWakeupEnabled : 1; USHORT Reserved : 14; };
end union

type USB_INTERFACE_STATUS as _USB_INTERFACE_STATUS
type PUSB_INTERFACE_STATUS as _USB_INTERFACE_STATUS ptr

union _USB_ENDPOINT_STATUS
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT Halt : 1; USHORT Reserved : 15; };
end union

type USB_ENDPOINT_STATUS as _USB_ENDPOINT_STATUS
type PUSB_ENDPOINT_STATUS as _USB_ENDPOINT_STATUS ptr

type _USB_COMMON_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
end type

type USB_COMMON_DESCRIPTOR as _USB_COMMON_DESCRIPTOR
type PUSB_COMMON_DESCRIPTOR as _USB_COMMON_DESCRIPTOR ptr

type _USB_DEVICE_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bcdUSB as USHORT
	bDeviceClass as UCHAR
	bDeviceSubClass as UCHAR
	bDeviceProtocol as UCHAR
	bMaxPacketSize0 as UCHAR
	idVendor as USHORT
	idProduct as USHORT
	bcdDevice as USHORT
	iManufacturer as UCHAR
	iProduct as UCHAR
	iSerialNumber as UCHAR
	bNumConfigurations as UCHAR
end type

type USB_DEVICE_DESCRIPTOR as _USB_DEVICE_DESCRIPTOR
type PUSB_DEVICE_DESCRIPTOR as _USB_DEVICE_DESCRIPTOR ptr
const USB_DEVICE_CLASS_RESERVED = &h00
const USB_DEVICE_CLASS_AUDIO = &h01
const USB_DEVICE_CLASS_COMMUNICATIONS = &h02
const USB_DEVICE_CLASS_HUMAN_INTERFACE = &h03
const USB_DEVICE_CLASS_MONITOR = &h04
const USB_DEVICE_CLASS_PHYSICAL_INTERFACE = &h05
const USB_DEVICE_CLASS_POWER = &h06
const USB_DEVICE_CLASS_IMAGE = &h06
const USB_DEVICE_CLASS_PRINTER = &h07
const USB_DEVICE_CLASS_STORAGE = &h08
const USB_DEVICE_CLASS_HUB = &h09
const USB_DEVICE_CLASS_CDC_DATA = &h0a
const USB_DEVICE_CLASS_SMART_CARD = &h0b
const USB_DEVICE_CLASS_CONTENT_SECURITY = &h0d
const USB_DEVICE_CLASS_VIDEO = &h0e
const USB_DEVICE_CLASS_PERSONAL_HEALTHCARE = &h0f
const USB_DEVICE_CLASS_AUDIO_VIDEO = &h10
const USB_DEVICE_CLASS_BILLBOARD = &h11
const USB_DEVICE_CLASS_DIAGNOSTIC_DEVICE = &hdc
const USB_DEVICE_CLASS_WIRELESS_CONTROLLER = &he0
const USB_DEVICE_CLASS_MISCELLANEOUS = &hef
const USB_DEVICE_CLASS_APPLICATION_SPECIFIC = &hfe
const USB_DEVICE_CLASS_VENDOR_SPECIFIC = &hff

type _USB_DEVICE_QUALIFIER_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bcdUSB as USHORT
	bDeviceClass as UCHAR
	bDeviceSubClass as UCHAR
	bDeviceProtocol as UCHAR
	bMaxPacketSize0 as UCHAR
	bNumConfigurations as UCHAR
	bReserved as UCHAR
end type

type USB_DEVICE_QUALIFIER_DESCRIPTOR as _USB_DEVICE_QUALIFIER_DESCRIPTOR
type PUSB_DEVICE_QUALIFIER_DESCRIPTOR as _USB_DEVICE_QUALIFIER_DESCRIPTOR ptr

type _USB_BOS_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	wTotalLength as USHORT
	bNumDeviceCaps as UCHAR
end type

type USB_BOS_DESCRIPTOR as _USB_BOS_DESCRIPTOR
type PUSB_BOS_DESCRIPTOR as _USB_BOS_DESCRIPTOR ptr
const USB_DEVICE_CAPABILITY_WIRELESS_USB = &h01
const USB_DEVICE_CAPABILITY_USB20_EXTENSION = &h02
const USB_DEVICE_CAPABILITY_SUPERSPEED_USB = &h03
const USB_DEVICE_CAPABILITY_CONTAINER_ID = &h04
const USB_DEVICE_CAPABILITY_PLATFORM = &h05
const USB_DEVICE_CAPABILITY_POWER_DELIVERY = &h06
const USB_DEVICE_CAPABILITY_BATTERY_INFO = &h07
const USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT = &h08
const USB_DEVICE_CAPABILITY_PD_PROVIDER_PORT = &h09
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB = &h0A
const USB_DEVICE_CAPABILITY_PRECISION_TIME_MEASUREMENT = &h0B
const USB_DEVICE_CAPABILITY_BILLBOARD = &h0D

union _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR_bmAttributes
	AsUlong as ULONG
	'' TODO: __C89_NAMELESS struct { ULONG Reserved:1; ULONG LPMCapable:1; ULONG BESLAndAlternateHIRDSupported:1; ULONG BaselineBESLValid:1; ULONG DeepBESLValid:1; ULONG Reserved1:3; ULONG BaselineBESL:4; ULONG DeepBESL:4; ULONG Reserved2:16; };
end union

type _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bmAttributes as _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR_bmAttributes
end type

type USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR as _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR as _USB_DEVICE_CAPABILITY_USB20_EXTENSION_DESCRIPTOR ptr
const USB_DEVICE_CAPABILITY_USB20_EXTENSION_BMATTRIBUTES_RESERVED_MASK = &hffff00e1

union _USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR_bmAttributes
	AsUlong as ULONG
	'' TODO: __C89_NAMELESS struct { ULONG Reserved1:1; ULONG BatteryCharging:1; ULONG USBPowerDelivery:1; ULONG Provider:1; ULONG Consumer:1; ULONG ChargingPolicy:1; ULONG TypeCCurrent:1; ULONG Reserved2:1; ULONG ACSupply:1; ULONG Battery:1; ULONG Other:1; ULONG NumBatteries:3; ULONG UsesVbus:1; ULONG Reserved3:17; };
end union

type _USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bReserved as UCHAR
	bmAttributes as _USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR_bmAttributes
	bmProviderPorts as USHORT
	bmConsumerPorts as USHORT
	bcdBCVersion as USHORT
	bcdPDVersion as USHORT
	bcdUSBTypeCVersion as USHORT
end type

type USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR as _USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR as _USB_DEVICE_CAPABILITY_POWER_DELIVERY_DESCRIPTOR ptr

union _USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR_bmCapabilities
	AsUshort as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT BatteryCharging:1; USHORT USBPowerDelivery:1; USHORT USBTypeCCurrent:1; USHORT Reserved:13; };
end union

type _USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bReserved as UCHAR
	bmCapabilities as _USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR_bmCapabilities
	wMinVoltage as USHORT
	wMaxVoltage as USHORT
	wReserved as USHORT
	dwMaxOperatingPower as ULONG
	dwMaxPeakPower as ULONG
	dwMaxPeakPowerTime as ULONG
end type

type USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR as _USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR as _USB_DEVICE_CAPABILITY_PD_CONSUMER_PORT_DESCRIPTOR ptr

type _USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bmAttributes as UCHAR
	wSpeedsSupported as USHORT
	bFunctionalitySupport as UCHAR
	bU1DevExitLat as UCHAR
	wU2DevExitLat as USHORT
end type

type USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR as _USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR as _USB_DEVICE_CAPABILITY_SUPERSPEED_USB_DESCRIPTOR ptr
const USB_DEVICE_CAPABILITY_SUPERSPEED_BMATTRIBUTES_RESERVED_MASK = &hfd
const USB_DEVICE_CAPABILITY_SUPERSPEED_BMATTRIBUTES_LTM_CAPABLE = &h02
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_RESERVED_MASK = &hfff0
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_LOW = &h0001
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_FULL = &h0002
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_HIGH = &h0004
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_SUPER = &h0008
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_LOW = &h0001
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_FULL = &h0002
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_HIGH = &h0004
const USB_DEVICE_CAPABILITY_SUPERSPEED_SPEEDS_SUPPORTED_SUPER = &h0008
const USB_DEVICE_CAPABILITY_SUPERSPEED_U1_DEVICE_EXIT_MAX_VALUE = &h0a
const USB_DEVICE_CAPABILITY_SUPERSPEED_U2_DEVICE_EXIT_MAX_VALUE = &h07ff
const USB_DEVICE_CAPABILITY_MAX_U1_LATENCY = &h0a
const USB_DEVICE_CAPABILITY_MAX_U2_LATENCY = &h07ff
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_BPS = 0
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_KBPS = 1
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_MBPS = 2
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_LSE_GBPS = 3
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_MODE_SYMMETRIC = 0
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_MODE_ASYMMETRIC = 1
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_RX = 0
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_DIR_TX = 1
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_PROTOCOL_SS = 0
const USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED_PROTOCOL_SSP = 1

union _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED
	AsUlong32 as ULONG
	'' TODO: __C89_NAMELESS struct { ULONG SublinkSpeedAttrID:4; ULONG LaneSpeedExponent:2; ULONG SublinkTypeMode:1; ULONG SublinkTypeDir:1; ULONG Reserved:6; ULONG LinkProtocol:2; ULONG LaneSpeedMantissa:16; };
end union

type USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED as _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED
type PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED as _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED ptr

union _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_bmAttributes
	AsUlong as ULONG
	'' TODO: __C89_NAMELESS struct { ULONG SublinkSpeedAttrCount:5; ULONG SublinkSpeedIDCount:4; ULONG Reserved:23; };
end union

union _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_wFunctionalitySupport
	AsUshort as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT SublinkSpeedAttrID:4; USHORT Reserved:4; USHORT MinRxLaneCount:4; USHORT MinTxLaneCount:4; };
end union

type _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bReserved as UCHAR
	bmAttributes as _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_bmAttributes
	wFunctionalitySupport as _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR_wFunctionalitySupport
	wReserved as USHORT
	bmSublinkSpeedAttr(0 to 0) as USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_SPEED
end type

type USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR as _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR as _USB_DEVICE_CAPABILITY_SUPERSPEEDPLUS_USB_DESCRIPTOR ptr

type _USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bReserved as UCHAR
	ContainerID(0 to 15) as UCHAR
end type

type USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR as _USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR as _USB_DEVICE_CAPABILITY_CONTAINER_ID_DESCRIPTOR ptr

type _USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	bReserved as UCHAR
	PlatformCapabilityUuid as GUID
	CapabililityData(0 to 0) as UCHAR
end type

type USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR as _USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR as _USB_DEVICE_CAPABILITY_PLATFORM_DESCRIPTOR ptr

union _USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_VconnPower
	AsUshort as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT VConnPowerNeededForFullFunctionality:3; USHORT Reserved:12; USHORT NoVconnPowerRequired:1; };
end union

type _USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
	iAddtionalInfoURL as UCHAR
	bNumberOfAlternateModes as UCHAR
	bPreferredAlternateMode as UCHAR
	VconnPower as _USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR_VconnPower
	bmConfigured(0 to 31) as UCHAR
	bReserved as ULONG
	'' TODO: __C89_NAMELESS struct { USHORT wSVID; UCHAR bAlternateMode; UCHAR iAlternateModeSetting; } AlternateMode[1];
end type

type USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR as _USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR as _USB_DEVICE_CAPABILITY_BILLBOARD_DESCRIPTOR ptr
'' TODO: DEFINE_GUID(GUID_USB_MSOS20_PLATFORM_CAPABILITY_ID, 0xD8DD60DF, 0x4589, 0x4CC7, 0x9C, 0xD2, 0x65, 0x9D, 0x9E, 0x64, 0x8A, 0x9F);

type _USB_DEVICE_CAPABILITY_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bDevCapabilityType as UCHAR
end type

type USB_DEVICE_CAPABILITY_DESCRIPTOR as _USB_DEVICE_CAPABILITY_DESCRIPTOR
type PUSB_DEVICE_CAPABILITY_DESCRIPTOR as _USB_DEVICE_CAPABILITY_DESCRIPTOR ptr

type _USB_CONFIGURATION_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	wTotalLength as USHORT
	bNumInterfaces as UCHAR
	bConfigurationValue as UCHAR
	iConfiguration as UCHAR
	bmAttributes as UCHAR
	MaxPower as UCHAR
end type

type USB_CONFIGURATION_DESCRIPTOR as _USB_CONFIGURATION_DESCRIPTOR
type PUSB_CONFIGURATION_DESCRIPTOR as _USB_CONFIGURATION_DESCRIPTOR ptr
const USB_CONFIG_POWERED_MASK = &hc0
const USB_CONFIG_BUS_POWERED = &h80
const USB_CONFIG_SELF_POWERED = &h40
const USB_CONFIG_REMOTE_WAKEUP = &h20
const USB_CONFIG_RESERVED = &h1f

type _USB_INTERFACE_ASSOCIATION_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bFirstInterface as UCHAR
	bInterfaceCount as UCHAR
	bFunctionClass as UCHAR
	bFunctionSubClass as UCHAR
	bFunctionProtocol as UCHAR
	iFunction as UCHAR
end type

type USB_INTERFACE_ASSOCIATION_DESCRIPTOR as _USB_INTERFACE_ASSOCIATION_DESCRIPTOR
type PUSB_INTERFACE_ASSOCIATION_DESCRIPTOR as _USB_INTERFACE_ASSOCIATION_DESCRIPTOR ptr

type _USB_INTERFACE_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bInterfaceNumber as UCHAR
	bAlternateSetting as UCHAR
	bNumEndpoints as UCHAR
	bInterfaceClass as UCHAR
	bInterfaceSubClass as UCHAR
	bInterfaceProtocol as UCHAR
	iInterface as UCHAR
end type

type USB_INTERFACE_DESCRIPTOR as _USB_INTERFACE_DESCRIPTOR
type PUSB_INTERFACE_DESCRIPTOR as _USB_INTERFACE_DESCRIPTOR ptr

type _USB_ENDPOINT_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bEndpointAddress as UCHAR
	bmAttributes as UCHAR
	wMaxPacketSize as USHORT
	bInterval as UCHAR
end type

type USB_ENDPOINT_DESCRIPTOR as _USB_ENDPOINT_DESCRIPTOR
type PUSB_ENDPOINT_DESCRIPTOR as _USB_ENDPOINT_DESCRIPTOR ptr
const USB_ENDPOINT_DIRECTION_MASK = &h80
#define USB_ENDPOINT_DIRECTION_OUT(addr) (((addr) and USB_ENDPOINT_DIRECTION_MASK) = 0)
#define USB_ENDPOINT_DIRECTION_IN(addr) ((addr) and USB_ENDPOINT_DIRECTION_MASK)
const USB_ENDPOINT_ADDRESS_MASK = &h0f
const USB_ENDPOINT_TYPE_MASK = &h03
const USB_ENDPOINT_TYPE_CONTROL = &h00
const USB_ENDPOINT_TYPE_ISOCHRONOUS = &h01
const USB_ENDPOINT_TYPE_BULK = &h02
const USB_ENDPOINT_TYPE_INTERRUPT = &h03
const USB_ENDPOINT_TYPE_BULK_RESERVED_MASK = &hfc
const USB_ENDPOINT_TYPE_CONTROL_RESERVED_MASK = &hfc
const USB_20_ENDPOINT_TYPE_INTERRUPT_RESERVED_MASK = &hfc
const USB_30_ENDPOINT_TYPE_INTERRUPT_RESERVED_MASK = &hcc
const USB_ENDPOINT_TYPE_ISOCHRONOUS_RESERVED_MASK = &hc0
const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_MASK = &h30
const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_PERIODIC = &h00
const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_NOTIFICATION = &h10
const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_RESERVED10 = &h20
const USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_RESERVED11 = &h30
#define USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE(bmAttr) (bmAttr and USB_30_ENDPOINT_TYPE_INTERRUPT_USAGE_MASK)
const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_MASK = &h0c
const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_NO_SYNCHRONIZATION = &h00
const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_ASYNCHRONOUS = &h04
const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_ADAPTIVE = &h08
const USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_SYNCHRONOUS = &h0c
#define USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION(bmAttr) (bmAttr and USB_ENDPOINT_TYPE_ISOCHRONOUS_SYNCHRONIZATION_MASK)
const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_MASK = &h30
const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_DATA_ENDOINT = &h00
const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_FEEDBACK_ENDPOINT = &h10
const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_IMPLICIT_FEEDBACK_DATA_ENDPOINT = &h20
const USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_RESERVED = &h30
#define USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE(bmAttr) (bmAttr and USB_ENDPOINT_TYPE_ISOCHRONOUS_USAGE_MASK)

union _USB_HIGH_SPEED_MAXPACKET
	'' TODO: __C89_NAMELESS struct _MP { USHORT MaxPacket : 11; USHORT HSmux : 2; USHORT Reserved : 3; };
	us as USHORT
end union

type USB_HIGH_SPEED_MAXPACKET as _USB_HIGH_SPEED_MAXPACKET
type PUSB_HIGH_SPEED_MAXPACKET as _USB_HIGH_SPEED_MAXPACKET ptr
const USB_ENDPOINT_SUPERSPEED_BULK_MAX_PACKET_SIZE = 1024
const USB_ENDPOINT_SUPERSPEED_CONTROL_MAX_PACKET_SIZE = 512
const USB_ENDPOINT_SUPERSPEED_ISO_MAX_PACKET_SIZE = 1024
const USB_ENDPOINT_SUPERSPEED_INTERRUPT_MAX_PACKET_SIZE = 1024

type _USB_STRING_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bString(0 to 0) as WCHAR
end type

type USB_STRING_DESCRIPTOR as _USB_STRING_DESCRIPTOR
type PUSB_STRING_DESCRIPTOR as _USB_STRING_DESCRIPTOR ptr
const MAXIMUM_USB_STRING_LENGTH = 255

type _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Bulk
	MaxStreams : 5 as UCHAR
	Reserved1 : 3 as UCHAR
end type

type _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Isochronous
	Mult : 2 as UCHAR
	Reserved2 : 5 as UCHAR
	SspCompanion : 1 as UCHAR
end type

union _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes
	AsUchar as UCHAR
	Bulk as _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Bulk
	Isochronous as _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes_Isochronous
end union

type _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bMaxBurst as UCHAR
	bmAttributes as _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR_bmAttributes
	wBytesPerInterval as USHORT
end type

type USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR as _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR
type PUSB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR as _USB_SUPERSPEED_ENDPOINT_COMPANION_DESCRIPTOR ptr
const USB_SUPERSPEED_ISOCHRONOUS_MAX_MULTIPLIER = 2

type _USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	wReserved as USHORT
	dwBytesPerInterval as ULONG
end type

type USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR as _USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR
type PUSB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR as _USB_SUPERSPEEDPLUS_ISOCH_ENDPOINT_COMPANION_DESCRIPTOR ptr
const USB_SUPERSPEEDPLUS_ISOCHRONOUS_MIN_BYTESPERINTERVAL = &hc001
const USB_SUPERSPEEDPLUS_ISOCHRONOUS_MAX_BYTESPERINTERVAL = &hffffff

type _USB_HUB_DESCRIPTOR
	bDescriptorLength as UCHAR
	bDescriptorType as UCHAR
	bNumberOfPorts as UCHAR
	wHubCharacteristics as USHORT
	bPowerOnToPowerGood as UCHAR
	bHubControlCurrent as UCHAR
	bRemoveAndPowerMask(0 to 63) as UCHAR
end type

type USB_HUB_DESCRIPTOR as _USB_HUB_DESCRIPTOR
type PUSB_HUB_DESCRIPTOR as _USB_HUB_DESCRIPTOR ptr
const USB_20_HUB_DESCRIPTOR_TYPE = &h29

type _USB_30_HUB_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bNumberOfPorts as UCHAR
	wHubCharacteristics as USHORT
	bPowerOnToPowerGood as UCHAR
	bHubControlCurrent as UCHAR
	bHubHdrDecLat as UCHAR
	wHubDelay as USHORT
	DeviceRemovable as USHORT
end type

type USB_30_HUB_DESCRIPTOR as _USB_30_HUB_DESCRIPTOR
type PUSB_30_HUB_DESCRIPTOR as _USB_30_HUB_DESCRIPTOR ptr
const USB_30_HUB_DESCRIPTOR_TYPE = &h2a
const USB_REQUEST_GET_STATE = &h02
const USB_REQUEST_CLEAR_TT_BUFFER = &h08
const USB_REQUEST_RESET_TT = &h09
const USB_REQUEST_GET_TT_STATE = &h0a
const USB_REQUEST_STOP_TT = &h0b
const USB_REQUEST_SET_HUB_DEPTH = &h0c
const USB_REQUEST_GET_PORT_ERR_COUNT = &h0d

union _USB_HUB_STATUS
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT LocalPowerLost:1; USHORT OverCurrent:1; USHORT Reserved:14; };
end union

type USB_HUB_STATUS as _USB_HUB_STATUS
type PUSB_HUB_STATUS as _USB_HUB_STATUS ptr

union _USB_HUB_CHANGE
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT LocalPowerChange:1; USHORT OverCurrentChange:1; USHORT Reserved:14; };
end union

type USB_HUB_CHANGE as _USB_HUB_CHANGE
type PUSB_HUB_CHANGE as _USB_HUB_CHANGE ptr

union _USB_HUB_STATUS_AND_CHANGE
	AsUlong32 as ULONG
	'' TODO: __C89_NAMELESS struct { USB_HUB_STATUS HubStatus; USB_HUB_CHANGE HubChange; };
end union

type USB_HUB_STATUS_AND_CHANGE as _USB_HUB_STATUS_AND_CHANGE
type PUSB_HUB_STATUS_AND_CHANGE as _USB_HUB_STATUS_AND_CHANGE ptr

union _USB_20_PORT_STATUS
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT CurrentConnectStatus:1; USHORT PortEnabledDisabled:1; USHORT Suspend:1; USHORT OverCurrent:1; USHORT Reset:1; USHORT Reserved0:3; USHORT PortPower:1; USHORT LowSpeedDeviceAttached:1; USHORT HighSpeedDeviceAttached:1; USHORT PortTestMode:1; USHORT PortIndicatorControl:1; USHORT Reserved1:3; };
end union

type USB_20_PORT_STATUS as _USB_20_PORT_STATUS
type PUSB_20_PORT_STATUS as _USB_20_PORT_STATUS ptr
const USB_PORT_STATUS_CONNECT = &h0001
const USB_PORT_STATUS_ENABLE = &h0002
const USB_PORT_STATUS_SUSPEND = &h0004
const USB_PORT_STATUS_OVER_CURRENT = &h0008
const USB_PORT_STATUS_RESET = &h0010
const USB_PORT_STATUS_POWER = &h0100
const USB_PORT_STATUS_LOW_SPEED = &h0200
const USB_PORT_STATUS_HIGH_SPEED = &h0400

union _USB_20_PORT_CHANGE
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT ConnectStatusChange:1; USHORT PortEnableDisableChange:1; USHORT SuspendChange:1; USHORT OverCurrentIndicatorChange:1; USHORT ResetChange:1; USHORT Reserved2:11; };
end union

type USB_20_PORT_CHANGE as _USB_20_PORT_CHANGE
type PUSB_20_PORT_CHANGE as _USB_20_PORT_CHANGE ptr

union _USB_30_PORT_STATUS
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT CurrentConnectStatus:1; USHORT PortEnabledDisabled:1; USHORT Reserved0:1; USHORT OverCurrent:1; USHORT Reset:1; USHORT PortLinkState:4; USHORT PortPower:1; USHORT NegotiatedDeviceSpeed:3; USHORT Reserved1:3; };
end union

type USB_30_PORT_STATUS as _USB_30_PORT_STATUS
type PUSB_30_PORT_STATUS as _USB_30_PORT_STATUS ptr
const PORT_LINK_STATE_U0 = 0
const PORT_LINK_STATE_U1 = 1
const PORT_LINK_STATE_U2 = 2
const PORT_LINK_STATE_U3 = 3
const PORT_LINK_STATE_DISABLED = 4
const PORT_LINK_STATE_RX_DETECT = 5
const PORT_LINK_STATE_INACTIVE = 6
const PORT_LINK_STATE_POLLING = 7
const PORT_LINK_STATE_RECOVERY = 8
const PORT_LINK_STATE_HOT_RESET = 9
const PORT_LINK_STATE_COMPLIANCE_MODE = 10
const PORT_LINK_STATE_LOOPBACK = 11
const PORT_LINK_STATE_TEST_MODE = 11

union _USB_30_PORT_CHANGE
	AsUshort16 as USHORT
	'' TODO: __C89_NAMELESS struct { USHORT ConnectStatusChange:1; USHORT Reserved2:2; USHORT OverCurrentIndicatorChange:1; USHORT ResetChange:1; USHORT BHResetChange:1; USHORT PortLinkStateChange:1; USHORT PortConfigErrorChange:1; USHORT Reserved3:8; };
end union

type USB_30_PORT_CHANGE as _USB_30_PORT_CHANGE
type PUSB_30_PORT_CHANGE as _USB_30_PORT_CHANGE ptr

union _USB_PORT_STATUS
	AsUshort16 as USHORT
	Usb20PortStatus as USB_20_PORT_STATUS
	Usb30PortStatus as USB_30_PORT_STATUS
end union

type USB_PORT_STATUS as _USB_PORT_STATUS
type PUSB_PORT_STATUS as _USB_PORT_STATUS ptr

union _USB_PORT_CHANGE
	AsUshort16 as USHORT
	Usb20PortChange as USB_20_PORT_CHANGE
	Usb30PortChange as USB_30_PORT_CHANGE
end union

type USB_PORT_CHANGE as _USB_PORT_CHANGE
type PUSB_PORT_CHANGE as _USB_PORT_CHANGE ptr

union _USB_PORT_EXT_STATUS
	AsUlong32 as ULONG
	'' TODO: __C89_NAMELESS struct { ULONG RxSublinkSpeedID:4; ULONG TxSublinkSpeedID:4; ULONG RxLaneCount:4; ULONG TxLaneCount:4; ULONG Reserved:16; };
end union

type USB_PORT_EXT_STATUS as _USB_PORT_EXT_STATUS
type PUSB_PORT_EXT_STATUS as _USB_PORT_EXT_STATUS ptr

union _USB_PORT_STATUS_AND_CHANGE
	AsUlong32 as ULONG
	'' TODO: __C89_NAMELESS struct { USB_PORT_STATUS PortStatus; USB_PORT_CHANGE PortChange; };
end union

type USB_PORT_STATUS_AND_CHANGE as _USB_PORT_STATUS_AND_CHANGE
type PUSB_PORT_STATUS_AND_CHANGE as _USB_PORT_STATUS_AND_CHANGE ptr

union _USB_PORT_EXT_STATUS_AND_CHANGE
	AsUlong64 as ULONG64
	'' TODO: __C89_NAMELESS struct { USB_PORT_STATUS_AND_CHANGE PortStatusChange; USB_PORT_EXT_STATUS PortExtStatus; };
end union

type USB_PORT_EXT_STATUS_AND_CHANGE as _USB_PORT_EXT_STATUS_AND_CHANGE
type PUSB_PORT_EXT_STATUS_AND_CHANGE as _USB_PORT_EXT_STATUS_AND_CHANGE ptr

union _USB_HUB_30_PORT_REMOTE_WAKE_MASK
	AsUchar8 as UCHAR
	'' TODO: __C89_NAMELESS struct { UCHAR ConnectRemoteWakeEnable:1; UCHAR DisconnectRemoteWakeEnable:1; UCHAR OverCurrentRemoteWakeEnable:1; UCHAR Reserved0:5; };
end union

type USB_HUB_30_PORT_REMOTE_WAKE_MASK as _USB_HUB_30_PORT_REMOTE_WAKE_MASK
type PUSB_HUB_30_PORT_REMOTE_WAKE_MASK as _USB_HUB_30_PORT_REMOTE_WAKE_MASK ptr

union _USB_FUNCTION_SUSPEND_OPTIONS
	AsUchar as UCHAR
	'' TODO: __C89_NAMELESS struct { UCHAR PowerState:1; UCHAR RemoteWakeEnabled:1; UCHAR Reserved:6; };
end union

type USB_FUNCTION_SUSPEND_OPTIONS as _USB_FUNCTION_SUSPEND_OPTIONS
type PUSB_FUNCTION_SUSPEND_OPTIONS as _USB_FUNCTION_SUSPEND_OPTIONS ptr
const USB_FEATURE_INTERFACE_POWER_D0 = &h0002
const USB_FEATURE_INTERFACE_POWER_D1 = &h0003
const USB_FEATURE_INTERFACE_POWER_D2 = &h0004
const USB_FEATURE_INTERFACE_POWER_D3 = &h0005
const USB_SUPPORT_D0_COMMAND = &h01
const USB_SUPPORT_D1_COMMAND = &h02
const USB_SUPPORT_D2_COMMAND = &h04
const USB_SUPPORT_D3_COMMAND = &h08
const USB_SUPPORT_D1_WAKEUP = &h10
const USB_SUPPORT_D2_WAKEUP = &h20

type _USB_CONFIGURATION_POWER_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	SelfPowerConsumedD0(0 to 2) as UCHAR
	bPowerSummaryId as UCHAR
	bBusPowerSavingD1 as UCHAR
	bSelfPowerSavingD1 as UCHAR
	bBusPowerSavingD2 as UCHAR
	bSelfPowerSavingD2 as UCHAR
	bBusPowerSavingD3 as UCHAR
	bSelfPowerSavingD3 as UCHAR
	TransitionTimeFromD1 as USHORT
	TransitionTimeFromD2 as USHORT
	TransitionTimeFromD3 as USHORT
end type

type USB_CONFIGURATION_POWER_DESCRIPTOR as _USB_CONFIGURATION_POWER_DESCRIPTOR
type PUSB_CONFIGURATION_POWER_DESCRIPTOR as _USB_CONFIGURATION_POWER_DESCRIPTOR ptr

type _USB_INTERFACE_POWER_DESCRIPTOR
	bLength as UCHAR
	bDescriptorType as UCHAR
	bmCapabilitiesFlags as UCHAR
	bBusPowerSavingD1 as UCHAR
	bSelfPowerSavingD1 as UCHAR
	bBusPowerSavingD2 as UCHAR
	bSelfPowerSavingD2 as UCHAR
	bBusPowerSavingD3 as UCHAR
	bSelfPowerSavingD3 as UCHAR
	TransitionTimeFromD1 as USHORT
	TransitionTimeFromD2 as USHORT
	TransitionTimeFromD3 as USHORT
end type

type USB_INTERFACE_POWER_DESCRIPTOR as _USB_INTERFACE_POWER_DESCRIPTOR
type PUSB_INTERFACE_POWER_DESCRIPTOR as _USB_INTERFACE_POWER_DESCRIPTOR ptr
#define USBRPMAPI DECLSPEC_IMPORT

type _USBRPM_DEVICE_INFORMATION
	HubId as ULONG64
	ConnectionIndex as ULONG
	DeviceClass as UCHAR
	VendorId as USHORT
	ProductId as USHORT
	ManufacturerString(0 to 254) as WCHAR
	ProductString(0 to 254) as WCHAR
	HubSymbolicLinkName(0 to MAX_PATH - 1) as WCHAR
end type

type USBRPM_DEVICE_INFORMATION as _USBRPM_DEVICE_INFORMATION
type PUSBRPM_DEVICE_INFORMATION as _USBRPM_DEVICE_INFORMATION ptr

type _USBRPM_DEVICE_LIST
	NumberOfDevices as ULONG
	Device(0 to -1) as USBRPM_DEVICE_INFORMATION
end type

type USBRPM_DEVICE_LIST as _USBRPM_DEVICE_LIST
type PUSBRPM_DEVICE_LIST as _USBRPM_DEVICE_LIST ptr
'' TODO: DECLSPEC_IMPORT NTSTATUS NTAPI RPMRegisterAlternateDriver( PDRIVER_OBJECT DriverObject, LPCWSTR CompatibleId, PHANDLE RegisteredDriver);
'' TODO: DECLSPEC_IMPORT NTSTATUS NTAPI RPMUnregisterAlternateDriver( HANDLE RegisteredDriver);
'' TODO: DECLSPEC_IMPORT NTSTATUS RPMGetAvailableDevices( HANDLE RegisteredDriver, USHORT Locale, PUSBRPM_DEVICE_LIST *DeviceList);
'' TODO: DECLSPEC_IMPORT NTSTATUS NTAPI RPMLoadAlternateDriverForDevice( HANDLE RegisteredDriver, ULONG64 HubID, ULONG ConnectionIndex, REFGUID OwnerGuid);
'' TODO: DECLSPEC_IMPORT NTSTATUS NTAPI RPMUnloadAlternateDriverForDevice( HANDLE RegisteredDriver, ULONG64 HubID, ULONG ConnectionIndex);
